<template>
  <div class="container" >
   
    <!-- 卡转让组件 -->
    <div v-for="(item ,index) in list" :key="index" @click="toDetail(item)">
      <div
        class="card"
        v-if="item.status == 0"
        :style="{background: 'url(' + imgUrl+item.style_pic + ')', backgroundSize:'100% ,100%'}"
      >
        <div class="title">{{item.name}}</div>
        <div class="desc" v-if="item.describe">{{item.describe}}</div>
        <div class="date">{{item.validity_start_time}}-{{item.validity_end_time}}</div>
        <div class="transferBtn" v-if="item.allow_transfer == 1" @click.stop="toOrder(1,item)">
          转让
        </div>
        <div class="sellBtn" v-if="item.allow_hangon == 1" @click.stop="toOrder(2,item)">挂售</div>
        <div class="line"></div>
      </div>
    </div>
  </div>
</template>

<script>
import common from "@/assets/js/mmk_common.js";
export default {
  data() {
    return {
      imgUrl: "https://img.ameimeika.com/" //img 域名
    };
  },
  props: {
    list: ""
  },
  methods: {
    toOrder(e, item) {
      //跳转到卡下单
      wx.navigateTo({
        url:
          "/pages/ct_store/transfer_sale/main?orderType=" +
          e +
          "&type=1" +
          "&id=" +
          item.id
      });
    },
    toDetail(item){
       wx.navigateTo({
        url:
          "/pages/ct_store/ct_detail_flea/main?type=1&source=2&opt=2&id=" +
          item.id       
      });
    }
  },
  watch: {},

  onLoad() {},
  destroyed() {}
};
</script>


<style lang="less" scoped>
.container {
  // background: #f3f4f6;
  height: auto;
  box-sizing: border-box;
  padding: 12px 12px 0;
 
  .card {
    height: 155px;
    width: 100%;
    box-sizing: border-box;
    background-size: 100% 100%;
    color: #fff;
    border-radius: 8px;
    position: relative;
    padding: 20px 16px 14px 20px;
    margin-bottom: 12px;
    overflow: hidden;
    .title {
      font-size: 18px;
      font-weight: 500;
      color: rgba(255, 255, 255, 1);
      margin-bottom: 5px;
    }
    .desc {
      width: 85%;
      height: 40px;
      font-size: 14px;
      font-weight: 400;
      color: rgba(255, 255, 255, 0.7);
      line-height: 20px;
      margin-bottom: 35px;
      overflow: hidden;
      text-overflow: ellipsis;
      display: -webkit-box;
      -webkit-line-clamp: 2;
      -webkit-box-orient: vertical;
    }
    .date {
      color: #5e2e1c;
    }
    .line{
      position: absolute;
      height: 44px;
      width: 100%;
      bottom: 0;
      left: 0;
      background:linear-gradient(90deg,rgba(255,255,255,0.48) 0%,rgba(255,255,255,0.21) 100%);
    }
    .transferBtn {
      width: 40px;
      height: 26px;
      background: rgba(255, 255, 255, 0.7);
      border-radius: 6px;
      font-size: 12px;
      color: rgba(94, 46, 28, 1);
      text-align: center;
      line-height: 26px;
      position: absolute;
      bottom: 8px;
      right: 12px;
      z-index: 999;
    }
    .sellBtn {
      width: 40px;
      height: 26px;
      border-radius: 6px;
      border: 1px solid rgba(255, 255, 255, 1);
      color: rgba(255, 255, 255, 1);
      font-size: 12px;
      line-height: 26px;
      text-align: center;
      position: absolute;
      bottom: 6px;
      right: 62px;
      z-index: 999;
    }
  }
}
</style>


